package com.shujia.java.day17.demo3;

import java.io.FileWriter;

/**
 * @Description: Demo2  д����
 * @Author: �����
 * @Date: 2019/8/19 15:06
 * <p>
 * <p>
 * 5��write
 * write(int)   д����ֽڵ�ASCII��ֵ
 * write(String)  д���ַ���
 * write(String,int off,int len)  д���ַ�����һ����
 * write(char[] ) д��char����
 */
public class Demo2 {
    public static void main(String[] args) throws Exception {
        //������
        FileWriter fw = new FileWriter("test4.txt");
        //д������
        //fw.write(104);
        //fw.write("�Ұ��й�");
//        String str="�Ұ��й�";
//        fw.write(str,0,2);

        /**
         * @Description: Demo2
         * @Author: �����
         * @Date: 2019/8/19 15:17
         *
         * д�뵽���ļ��͵�ǰ�ļ��ı����ʽ����һֱ
         */
        char[] chars = new char[1024];
        chars[0] = 'h';
        chars[1] = 'e';
        chars[2] = 'l';
        chars[3] = 'l';
        chars[4] = 'o';


//
//      fw.write(chars);

        fw.write(chars, 0, 5);
        //�ر���
        fw.close();
    }
}
